angular.module('fs.waf').controller('modalDemoCtrl2', [
  '$scope',
  '$translate',
  '$templateCache',
  '$locale',
  'storageService',
  'dialogsModule',
  '$uibModalInstance',
  function($scope, $translate, $templateCache, $locale, storageService, dialogsModule, $uibModalInstance) {
    console.log('2222');

    var ctrl = this;

    ctrl.dialogsModule = dialogsModule;

    ctrl.fsGridConfig = {
      fsColor: {
        name: 'color',
        label: 'color',
        model: 'colorValue',
        type: 'color',
        size: 4,
        rules: '', //验证规则
        filter: '', //过滤器
        // prefix: 'C', //输入前缀
        inputClass: 'aaa', //输入框样式
        tooltipTemplateUrl: '', //提示器模板路径
        tooltipClass: 'bbb', //提示器样式
        isRequired: false, //添加红色*的样式
        showLabel: false, //是否显示标题
        placeholder: 'color',
        tooltip: 'color',
        help: 'color',
        uppercase: true
      }
    };

    ctrl.ok = function() {
      if (!dialogsModule.btnCallback || !dialogsModule.btnCallback['ok'] || dialogsModule.btnCallback['ok']([{ colorValue: ctrl.ngModel.colorValue }]) !== false) {
        $uibModalInstance.close();
      }
    };

    ctrl.close = function() {
      if (!dialogsModule.btnCallback || !dialogsModule.btnCallback['close'] || dialogsModule.btnCallback['close']() !== false) {
        $uibModalInstance.dismiss();
      }
    };
  }
]);
